Skip to content

Backport of upstream PR #1055: traced error err into#3

Closed
BatmanAoD wants to merge 2 commits into
rigetti-mainfrom
pr-1055-traced-error-err-into
Closed

Backport of upstream PR #1055: traced error err into#3
BatmanAoD wants to merge 2 commits into
rigetti-mainfrom
pr-1055-traced-error-err-into

Conversation

@BatmanAoD

Copy link
Copy Markdown
Collaborator

"local" version of tokio-rs#3555

@windsurf-bot windsurf-bot Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 🤙

💡 To request another review, post a new comment with "/windsurf-review".

@BatmanAoD BatmanAoD force-pushed the pr-1055-traced-error-err-into branch 2 times, most recently from acbbf51 to 635c708 Compare June 17, 2026 00:30
@BatmanAoD BatmanAoD changed the title Pr 1055 traced error err into Backport of upstream PR #1055: traced error err into Jun 17, 2026
@BatmanAoD BatmanAoD force-pushed the pr-1055-traced-error-err-into branch from a2cd246 to 979cc0e Compare June 17, 2026 00:42
Comment thread tracing-error/Cargo.toml Outdated
Comment on lines +3 to +4
# The '0.775' series is compatible with tracing-core 0.1, but is only published privately and used by Rigetti.
version = "0.775.0"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a "breaking" change, and inconsistent with the upstream convention of versioning all the tracing crates together. But tracing-error is not a transitive dependency anywhere; we only depend directly on it, so the version number doesn't need to match across dependencies outside of our control. And by using 775 as the minor version, we make it very unlikely our version numbers will ever collide with upstream version numbers, while also having a stable value that is familiar to Rigetti employees so that we can easily recognize it as coming from our fork.

yaahc and others added 2 commits June 17, 2026 09:07
## Motivation

Right now TracedError is pretty much incompatible with enum heavy error
handling implementations. The way its currently designed you'd have to make
sure that each leaf error independently is wrapped in a `TracedError` so that
all sources end up capturing a SpanTrace.

## Solution

To resolve this I've added a `map` method for transforming the inner type of a
TracedError while preserving the existing SpanTrace. This is still a bit
cumbersome, where before you'd be able to write `result.map_err(|source|
MyError { source, some_context })` now you'll have to write
`result.map_err(|source| source.map(|source| MyError { source, some_context
}))`. To fix this we should probably eventually add an extension trait on
`Result` but I want to experiment with that half of the change in `zebra`
before committing to an API, since it can easily be done out of tree.

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
@BatmanAoD BatmanAoD force-pushed the pr-1055-traced-error-err-into branch from 979cc0e to ade769c Compare June 17, 2026 15:08
@BatmanAoD

Copy link
Copy Markdown
Collaborator Author

We can't use the same branch for upstream PRs and "local" PRs.

@BatmanAoD BatmanAoD closed this Jun 17, 2026
@BatmanAoD

Copy link
Copy Markdown
Collaborator Author

Replaced by #5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants